package cn.rumoss.basic;

import java.util.HashMap;
import java.util.Hashtable;

/**
 * @ClassName MapTest
 * @Description //TODO
 * @Author HeCG
 * @Date 19-5-18 上午10:15
 */
public class MapTest {

    public static void main(String[] args) {

        HashMap hashMap = new HashMap();
        System.out.println(hashMap.put("key","Value1"));
        System.out.println(hashMap.put("key","Value"));
        System.out.println(hashMap.put(null,"Value2"));
        System.out.println(hashMap.get(null));

        Hashtable hashtable = new Hashtable();
        System.out.println(hashtable.put("key","Value1"));
        System.out.println(hashtable.put("key","Value"));
        System.out.println(hashtable.put("key2",null));
        System.out.println(hashtable.put(null,"Value2"));

    }

}
